//
//  MXFindBlockTypeElevenCollectionViewCell.m
//  MXの衣柜
//
//  Created by 马霄 on 15/8/15.
//  Copyright (c) 2015年 霄 马. All rights reserved.
//

#import "MXFindBlockTypeElevenCollectionViewCell.h"
#import "UIImageView+WebCache.h"
@implementation MXFindBlockTypeElevenCollectionViewCell
- (void)dealloc
{
    [_model release];
    [_mainImage release];
    [super dealloc];
}
-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        self.mainImage = [[[UIImageView alloc ] init] autorelease];
        self.mainImage.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:self.mainImage];
        
        
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    self.mainImage.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
}


- (void)getInfo:(MXFindDetailModel *)model rowNum:(NSInteger)rowNum
{
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    NSMutableArray *arr = [NSMutableArray array];
    for (NSDictionary *dict in model.product) {
        [arr addObject:[dict objectForKey:@"img"]];
    }
    [self.mainImage sd_setImageWithURL:[NSURL URLWithString:arr[rowNum]] placeholderImage:[UIImage imageNamed:@"plaseholder"]];
    
        
}


@end
